import numpy as np

def Init():
    n = int(input("(the number of vertex) n: "))
    m = int(input("(the number of arc) m: "))
    M = np.ones((n,n),int)
    M = M*np.inf

    for i in range(n):
        M[i,i] = 0
    print("u v w")
    for i in range(m):
        u = int(input(""))
        v = int(input(""))
        w = int(input(""))
        M[u,v] = w


    print(M)
    return M,m,n 


def Dijkstra(M,m,n,u):
    S = np.zeros(n,int)
    dist = np.ones(n,int)
    dist = dist * np.inf

    S[u] = 1;
    for i in range(n):
        dist[i] = 1



if __name__ == "__main__":
    Init()


